package com.example.a28796.beautiful.zhangyuqibean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2016/8/30.
 */
public class BeautyLocalBean {

    /**
     * code : 0
     * message : null
     * obj : {"listData":[{"hospital":{"hospitalId":490422,"hospitalName":"北京爱悦丽格医疗美容门诊部","approve":1,"headUrl":"http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg","type":"民营，门诊部","city":"北京","province":"北京","sceneEnabled":0,"cover":{"url":"http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg","w":810,"h":408,"status":null,"desc":null,"extra":null}},"stock":[{"stockId":272017,"title":"【BOTOX瘦脸针100u】主治医师卢璐注射","status":3},{"stockId":268259,"title":"【兰州衡力瘦脸针100u】主治医师卢璐注射","status":3}]},{"hospital":{"hospitalId":25460,"hospitalName":"北京欧华医疗美容","approve":1,"headUrl":"http://fq1.img.meidaila.net/150920/Fg_uaLdrX2oFmAitmf9hi-xK5sff.jpg","type":"民营，诊所","city":"北京","province":"北京","sceneEnabled":0,"cover":{"url":"http://fq1.img.meidaila.net/150920/Fg_uaLdrX2oFmAitmf9hi-xK5sff.jpg","w":810,"h":408,"status":null,"desc":null,"extra":null}},"stock":[{"stockId":772595,"title":"【光子嫩肤+调Q净肤+导入+1片面膜】","status":3},{"stockId":36015,"title":"【光子嫩肤】改善雀斑痘印色沉，红血丝","status":3}]},{"hospital":{"hospitalId":270241,"hospitalName":"北京悦丽汇医疗美容诊所","approve":1,"headUrl":"http://fq1.img.meidaila.net/150917/FutpToZ-LsPZjJ4isYR4jPGvPA9z.jpg","type":"民营，诊所","city":"北京","province":"北京","sceneEnabled":0,"cover":{"url":"http://fq1.img.meidaila.net/150917/FutpToZ-LsPZjJ4isYR4jPGvPA9z.jpg","w":810,"h":408,"status":null,"desc":null,"extra":null}},"stock":[{"stockId":720567,"title":"【面部整形】网红脸主治医师姚然操作","status":3},{"stockId":461775,"title":"【衡力瘦脸针】主治医师周宜国注射","status":3}]}]}
     * now : 1472552558
     * sign : null
     */

    private int code;
    private Object message;
    private ObjBean obj;
    private int now;
    private Object sign;

    public static BeautyLocalBean objectFromData(String str) {

        return new Gson().fromJson(str, BeautyLocalBean.class);
    }

    public static BeautyLocalBean objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), BeautyLocalBean.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<BeautyLocalBean> arrayBeautyLocalBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<BeautyLocalBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<BeautyLocalBean> arrayBeautyLocalBeanFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<BeautyLocalBean>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getMessage() {
        return message;
    }

    public void setMessage(Object message) {
        this.message = message;
    }

    public ObjBean getObj() {
        return obj;
    }

    public void setObj(ObjBean obj) {
        this.obj = obj;
    }

    public int getNow() {
        return now;
    }

    public void setNow(int now) {
        this.now = now;
    }

    public Object getSign() {
        return sign;
    }

    public void setSign(Object sign) {
        this.sign = sign;
    }

    public static class ObjBean {
        /**
         * hospital : {"hospitalId":490422,"hospitalName":"北京爱悦丽格医疗美容门诊部","approve":1,"headUrl":"http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg","type":"民营，门诊部","city":"北京","province":"北京","sceneEnabled":0,"cover":{"url":"http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg","w":810,"h":408,"status":null,"desc":null,"extra":null}}
         * stock : [{"stockId":272017,"title":"【BOTOX瘦脸针100u】主治医师卢璐注射","status":3},{"stockId":268259,"title":"【兰州衡力瘦脸针100u】主治医师卢璐注射","status":3}]
         */

        private List<ListDataBean> listData;

        public static ObjBean objectFromData(String str) {

            return new Gson().fromJson(str, ObjBean.class);
        }

        public static ObjBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), ObjBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<ObjBean> arrayObjBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<ObjBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<ObjBean> arrayObjBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<ObjBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public List<ListDataBean> getListData() {
            return listData;
        }

        public void setListData(List<ListDataBean> listData) {
            this.listData = listData;
        }

        public static class ListDataBean {
            /**
             * hospitalId : 490422
             * hospitalName : 北京爱悦丽格医疗美容门诊部
             * approve : 1
             * headUrl : http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg
             * type : 民营，门诊部
             * city : 北京
             * province : 北京
             * sceneEnabled : 0
             * cover : {"url":"http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg","w":810,"h":408,"status":null,"desc":null,"extra":null}
             */

            private HospitalBean hospital;
            /**
             * stockId : 272017
             * title : 【BOTOX瘦脸针100u】主治医师卢璐注射
             * status : 3
             */

            private List<StockBean> stock;

            public static ListDataBean objectFromData(String str) {

                return new Gson().fromJson(str, ListDataBean.class);
            }

            public static ListDataBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), ListDataBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<ListDataBean> arrayListDataBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<ListDataBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<ListDataBean> arrayListDataBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<ListDataBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public HospitalBean getHospital() {
                return hospital;
            }

            public void setHospital(HospitalBean hospital) {
                this.hospital = hospital;
            }

            public List<StockBean> getStock() {
                return stock;
            }

            public void setStock(List<StockBean> stock) {
                this.stock = stock;
            }

            public static class HospitalBean {
                private int hospitalId;
                private String hospitalName;
                private int approve;
                private String headUrl;
                private String type;
                private String city;
                private String province;
                private int sceneEnabled;
                /**
                 * url : http://fq1.img.meidaila.net/151224/FkpyL-4MfO3qtbWeqOD6OGdpK8Z5.jpg
                 * w : 810
                 * h : 408
                 * status : null
                 * desc : null
                 * extra : null
                 */

                private CoverBean cover;

                public static HospitalBean objectFromData(String str) {

                    return new Gson().fromJson(str, HospitalBean.class);
                }

                public static HospitalBean objectFromData(String str, String key) {

                    try {
                        JSONObject jsonObject = new JSONObject(str);

                        return new Gson().fromJson(jsonObject.getString(str), HospitalBean.class);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }

                    return null;
                }

                public static List<HospitalBean> arrayHospitalBeanFromData(String str) {

                    Type listType = new TypeToken<ArrayList<HospitalBean>>() {
                    }.getType();

                    return new Gson().fromJson(str, listType);
                }

                public static List<HospitalBean> arrayHospitalBeanFromData(String str, String key) {

                    try {
                        JSONObject jsonObject = new JSONObject(str);
                        Type listType = new TypeToken<ArrayList<HospitalBean>>() {
                        }.getType();

                        return new Gson().fromJson(jsonObject.getString(str), listType);

                    } catch (JSONException e) {
                        e.printStackTrace();
                    }

                    return new ArrayList();


                }

                public int getHospitalId() {
                    return hospitalId;
                }

                public void setHospitalId(int hospitalId) {
                    this.hospitalId = hospitalId;
                }

                public String getHospitalName() {
                    return hospitalName;
                }

                public void setHospitalName(String hospitalName) {
                    this.hospitalName = hospitalName;
                }

                public int getApprove() {
                    return approve;
                }

                public void setApprove(int approve) {
                    this.approve = approve;
                }

                public String getHeadUrl() {
                    return headUrl;
                }

                public void setHeadUrl(String headUrl) {
                    this.headUrl = headUrl;
                }

                public String getType() {
                    return type;
                }

                public void setType(String type) {
                    this.type = type;
                }

                public String getCity() {
                    return city;
                }

                public void setCity(String city) {
                    this.city = city;
                }

                public String getProvince() {
                    return province;
                }

                public void setProvince(String province) {
                    this.province = province;
                }

                public int getSceneEnabled() {
                    return sceneEnabled;
                }

                public void setSceneEnabled(int sceneEnabled) {
                    this.sceneEnabled = sceneEnabled;
                }

                public CoverBean getCover() {
                    return cover;
                }

                public void setCover(CoverBean cover) {
                    this.cover = cover;
                }

                public static class CoverBean {
                    private String url;
                    private int w;
                    private int h;
                    private Object status;
                    private Object desc;
                    private Object extra;

                    public static CoverBean objectFromData(String str) {

                        return new Gson().fromJson(str, CoverBean.class);
                    }

                    public static CoverBean objectFromData(String str, String key) {

                        try {
                            JSONObject jsonObject = new JSONObject(str);

                            return new Gson().fromJson(jsonObject.getString(str), CoverBean.class);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                        return null;
                    }

                    public static List<CoverBean> arrayCoverBeanFromData(String str) {

                        Type listType = new TypeToken<ArrayList<CoverBean>>() {
                        }.getType();

                        return new Gson().fromJson(str, listType);
                    }

                    public static List<CoverBean> arrayCoverBeanFromData(String str, String key) {

                        try {
                            JSONObject jsonObject = new JSONObject(str);
                            Type listType = new TypeToken<ArrayList<CoverBean>>() {
                            }.getType();

                            return new Gson().fromJson(jsonObject.getString(str), listType);

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                        return new ArrayList();


                    }

                    public String getUrl() {
                        return url;
                    }

                    public void setUrl(String url) {
                        this.url = url;
                    }

                    public int getW() {
                        return w;
                    }

                    public void setW(int w) {
                        this.w = w;
                    }

                    public int getH() {
                        return h;
                    }

                    public void setH(int h) {
                        this.h = h;
                    }

                    public Object getStatus() {
                        return status;
                    }

                    public void setStatus(Object status) {
                        this.status = status;
                    }

                    public Object getDesc() {
                        return desc;
                    }

                    public void setDesc(Object desc) {
                        this.desc = desc;
                    }

                    public Object getExtra() {
                        return extra;
                    }

                    public void setExtra(Object extra) {
                        this.extra = extra;
                    }
                }
            }

            public static class StockBean {
                private int stockId;
                private String title;
                private int status;

                public static StockBean objectFromData(String str) {

                    return new Gson().fromJson(str, StockBean.class);
                }

                public static StockBean objectFromData(String str, String key) {

                    try {
                        JSONObject jsonObject = new JSONObject(str);

                        return new Gson().fromJson(jsonObject.getString(str), StockBean.class);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }

                    return null;
                }

                public static List<StockBean> arrayStockBeanFromData(String str) {

                    Type listType = new TypeToken<ArrayList<StockBean>>() {
                    }.getType();

                    return new Gson().fromJson(str, listType);
                }

                public static List<StockBean> arrayStockBeanFromData(String str, String key) {

                    try {
                        JSONObject jsonObject = new JSONObject(str);
                        Type listType = new TypeToken<ArrayList<StockBean>>() {
                        }.getType();

                        return new Gson().fromJson(jsonObject.getString(str), listType);

                    } catch (JSONException e) {
                        e.printStackTrace();
                    }

                    return new ArrayList();


                }

                public int getStockId() {
                    return stockId;
                }

                public void setStockId(int stockId) {
                    this.stockId = stockId;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public int getStatus() {
                    return status;
                }

                public void setStatus(int status) {
                    this.status = status;
                }
            }
        }
    }
}
